package com.lxd.milktea.dataobject;


import lombok.Data;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * @ProjectName: milktea
 * @Package: com.lxd.milktea.dataobject
 * @ClassName: material
 * @Author: carrymaniac
 * @Description: 原料
 * @Date: 2020/5/2 5:41 下午
 * @Version:
 */

@Data
@Entity
@Table(name = "tb_material_re", schema = "milk", catalog = "")
public class MaterialRe {

    private int reId;
    private String materialId;
    private String sonMaterialId;
    private int needNum;
    private Timestamp createTime;
    private Timestamp updateTime;

    @Id
    @Column(name = "re_id")
    public int getReId() {
        return reId;
    }

    public void setReId(int reId) {
        this.reId = reId;
    }

    @Basic
    @Column(name = "material_id")
    public String getMaterialId() {
        return materialId;
    }

    public void setMaterialId(String materialId) {
        this.materialId = materialId;
    }

    @Basic
    @Column(name = "son_material_id")
    public String getSonMaterialId() {
        return sonMaterialId;
    }

    public void setSonMaterialId(String sonMaterialId) {
        this.sonMaterialId = sonMaterialId;
    }

    @Basic
    @Column(name = "need_num")
    public int getNeedNum() {
        return needNum;
    }

    public void setNeedNum(int needNum) {
        this.needNum = needNum;
    }

    @Basic
    @Column(name = "create_time")
    public Timestamp getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }

    @Basic
    @Column(name = "update_time")
    public Timestamp getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Timestamp updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        MaterialRe that = (MaterialRe) o;

        if (reId != that.reId) return false;
        if (needNum != that.needNum) return false;
        if (materialId != null ? !materialId.equals(that.materialId) : that.materialId != null) return false;
        if (sonMaterialId != null ? !sonMaterialId.equals(that.sonMaterialId) : that.sonMaterialId != null)
            return false;
        if (createTime != null ? !createTime.equals(that.createTime) : that.createTime != null) return false;
        if (updateTime != null ? !updateTime.equals(that.updateTime) : that.updateTime != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = reId;
        result = 31 * result + (materialId != null ? materialId.hashCode() : 0);
        result = 31 * result + (sonMaterialId != null ? sonMaterialId.hashCode() : 0);
        result = 31 * result + needNum;
        result = 31 * result + (createTime != null ? createTime.hashCode() : 0);
        result = 31 * result + (updateTime != null ? updateTime.hashCode() : 0);
        return result;
    }
}
